home *** CD-ROM | disk | FTP | other *** search
/ MACD 5 / MACD 5.bin / workbench / magicwb / czesc_2 / mwb_dopus / arexx / wincopy.dopus5 next >
Text File  |  1995-07-16  |  3KB  |  77 lines

  1. /* WinCopy v1.00 [16-Jul-1995] for Directory Opus 5.
  2.    By Leo Davidson ("Nudel", Pot-Noodle/Gods'Gift Utilities)
  3.  
  4.    NOTE: This script _requires_ DOpus v5.11 or above.
  5.  
  6.    NOTE: This script does *NOT* do the same thing as Gary Gagnon's
  7.          "CloneSRCE.dopus5" or "same.dopus5", read on...
  8.  
  9.    This script will copy the source lister to the destination lister,
  10.    like the old copywin command in DOpus4.
  11.  
  12.    If you wish to open a _new_ lister which is a copy of the source
  13.    one (as apposed to turning an existing lister into a copy of the
  14.    source), you should use Gary Gagnon's "CloneSRCR.dopus5" script,
  15.    which was included in the official DOpus v5.11 update as
  16.    "DOpus5:ARexx/same.dopus5". Gary's script is also able to clone
  17.    multiple source listers at once.
  18.  
  19.    If you specify the "PathOnly" option, the destination lister will
  20.    remain in the same place and simply read the same path as the source
  21.    lister. Otherwise, the destination lister will be moved and resized
  22.    such that it is identical to the source lister (personally, I'd
  23.    never want that, but the option is there if you do!).
  24.    Remember that if you do not use the "PathOnly" option the copied
  25.    lister may end up _behind_ your existing lister, giving the illusion
  26.    that it has in fact been closed.
  27.  
  28. Call as:
  29. ------------------------------------------------------------------------------
  30. ARexx    DOpus5:ARexx/WinCopy.dopus5 {Qp} [PathOnly]
  31. ------------------------------------------------------------------------------
  32. Turn off all switches.
  33. */
  34.  
  35. options results
  36. options failat 99
  37. signal on syntax;signal on ioerr        /* Error trapping */
  38. parse arg DOpusPort PathOnlyOption
  39. DOpusPort = Strip(Strip(DOpusPort,"B"," "),"B",'"')
  40. PathOnlyOption = Strip(Strip(PathOnlyOption,"B"," "),"B",'"')
  41. If DOpusPort~="" THEN Address value DOpusPort
  42. ELSE Do
  43.     Say "Not correctly called from Directory Opus 5!"
  44.     Say "Load this ARexx script into editor for more info."
  45.     EXIT
  46.     END
  47.  
  48. lister query source stem source_handle.
  49.  
  50. IF source_handle.count = 0 | source_handle.count = "SOURCE_HANDLE.COUNT" Then Do
  51.     dopus request '"You must have a SOURCE lister!" OK'
  52.     EXIT
  53.     End
  54.  
  55.  
  56. lister query dest stem dest_handle.
  57.  
  58. IF dest_handle.count = 0 | dest_handle.count = "DEST_HANDLE.COUNT" Then Do
  59.     dopus request '"You must have a DESTINATION lister!" OK'
  60.     EXIT
  61.     End
  62.  
  63.  
  64. lister query source_handle.0 path
  65. source_path = RESULT
  66. lister read dest_handle.0 source_path
  67.  
  68.  
  69. If PathOnlyOption ~= "PathOnly" Then Do
  70.     lister query source_handle.0 position
  71.     source_position = RESULT
  72.     lister set dest_handle.0 position source_position
  73.     END
  74.  
  75. syntax:;ioerr:                /* In case of error, jump here */
  76. EXIT
  77.